import React, { FC, useState } from 'react';
import { View, Text, Input } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { LoginFormContext, useLoginForm } from './LoginFormContext';
import PhoneNumber from './PhoneNumber/PhoneNumber';
import Code from './Code/Code';

export interface IProps extends ICompProps {}
LoginForm.defaultProps = {} as Partial<IProps>;
function LoginForm(props: IProps) {
    const { className, style } = props;
    const { loginForm, valChange, validateTips, validatePhone, setValidateTips } = useLoginForm();
    const localClassName = useClassName('LoginForm', className);
    return (
        <LoginFormContext.Provider value={{ loginForm, valChange, validateTips, validatePhone, setValidateTips }}>
            <RootView className={localClassName} style={style}>
                <PhoneNumber></PhoneNumber>
                <Code></Code>
            </RootView>
        </LoginFormContext.Provider>
    );
}
export default React.memo(LoginForm as FC<IProps>);
const RootView = styled(View)`
    &.LoginForm {

       
    }
`;
